package tp.pr5.items;

import tp.pr5.Player;
import tp.pr5.Room;

public class Food extends ExpirationItem {
	private int health;
	/**Metodod de la clase Expiration */
	public Food(String id, String description, int health,int times) {
		super(id, description, times);
		this.health=health;
	}
	public Food(String i,String d,int health)
	{
		super(i,d,1);
		this.health=health;
	}
	public boolean use(Player who,Room where)
	{
		if(!canBeUsed())
		{
			return false;
		}
		super.times=super.times-1;
		who.addHealth(this.health);
		if(super.times==0)
		{										//////
			
			who.removeItem(getId());
			}
		return true;
	}

}
